import React, { useState } from 'react';
import { PageContainer } from '@ant-design/pro-layout';

import QuestionList from '@/pages/Train/Question/list';
import CheckModule from '@/components/CheckModule';

const QuestionPage: React.FC = () => {
  const [selectMode, setSelectMode] = useState<boolean>(true);
  return (
    <CheckModule code={'TR'}>
      <PageContainer
        waterMarkProps={{ content: '' }}
        onTabChange={(k) => {
          if (k === 'courseware') {
            setSelectMode(true);
          } else {
            setSelectMode(false);
          }
        }}
        tabList={[
          {
            tab: '课件题库',
            key: 'courseware',
          },
          {
            tab: '计划题库',
            key: 'plan',
          },
        ]}
      >
        <QuestionList selectMode={selectMode} />
      </PageContainer>
    </CheckModule>
  );
};

export default QuestionPage;
